#include<bits/stdc++.h>
using namespace std;
int main(){
	int maxs,mins;
	int a,b;
	maxs=9999999,mins=0;
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a>>b;
//		if(mins<(a/(b+1)+1))
//			mins=max(mins,a/(b+1)+1);
	if(mins<(a/(b+1)+1))
		mins=a/(b+1)+1;
//		if(maxs>a/b)
			maxs=min(maxs,a/b);
	}
	cout<<mins<<' '<<maxs;
}
